package cn.caijiapeng.spt.kit;

import java.io.File;

public class ImageKit {
	/** 自定义图片重命名规则 */
	public static File rename(File file) {
		String path = file.getPath();
		String suffix = path.substring(path.lastIndexOf(".") + 1, path.length());
		String datepath = DateKit.getCurDate("yyyyMMddHHmmss") + RandomKit.getFixLenthString(6);
		String newFilePath = file.getParent() + File.separator + datepath + "." + suffix;
		File newFile = new File(newFilePath);
		file.renameTo(newFile);
		return newFile;
	}

}
